package com.gdufe.firesafe.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gdufe.firesafe.model.entity.DeviceEntity;
import com.gdufe.firesafe.model.entity.HouseEntity;
import com.gdufe.firesafe.model.vo.HouseBasicInfoVO;
import com.gdufe.firesafe.model.vo.HouseStatisticsVO;
import com.gdufe.firesafe.model.vo.HouseTreeVO;
import com.gdufe.firesafe.model.vo.ResponsibleForVO;
import com.gdufe.firesafe.utils.PageUtils;
import com.gdufe.firesafe.utils.R;

import java.util.List;
import java.util.Map;

/**
 * 房屋表
 *
 * @author Liu
 * @email
 * @date 2024-03-26 16:29:57
 */
public interface HouseService extends IService<HouseEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<HouseTreeVO> getHouseTree();

    String getHouseNameById(Integer id);

    /**
     * 计算房屋分数
     *
     * @param houseId
     * @return
     */
    double calculateHousePoint(Integer houseId);

//    //按性别计算房屋平均分
//    List<Double> calculateHousePointBySex(Integer inspectorId);

    /**
     * 获取业主分数
     *
     * @param ownerId
     * @return
     */
    R getOwnerPoint(Integer ownerId);

    /**
     * 获取房屋基本信息
     *
     * @param ownerId
     * @return
     */
    HouseBasicInfoVO getBasicInfo(Integer ownerId);

    /**
     * 房屋统计信息
     *
     * @param ownerId
     * @return
     */
    HouseStatisticsVO getSafeStatistics(Integer ownerId);

    /**
     * 根据buildingId得到该楼栋房屋数
     *
     * @param buildingId
     * @return
     */
    Integer getHouseNumByBuildingId(Integer buildingId);

    /**
     * 查询该检查员负责的房屋
     *
     * @param params
     * @param inspectorId
     * @return
     */
    IPage<ResponsibleForVO> getInspectorHouseList(Map<String, Object> params, Integer inspectorId);

    /**
     * 按性别区分的分数
     *
     * @param inspectorId
     * @return
     */
    List<List<Double>> getScoresBySex(Integer inspectorId);

    /**
     * 给房屋设置其设备
     *
     * @param device
     */
    void setDeviceIdWithDevice(DeviceEntity device);
}

